<?php

/**
 * Personalstructure form base class.
 *
 * @method Personalstructure getObject() Returns the current form's model object
 *
 * @package    symfony
 * @subpackage form
 * @author     Your name here
 */
abstract class BasePersonalstructureForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idPersonalStructure' => new sfWidgetFormInputHidden(),
      'orderId'             => new sfWidgetFormPropelChoice(array('model' => 'Clientorder', 'add_empty' => false)),
      'title'               => new sfWidgetFormInputText(),
      'text'                => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'idPersonalStructure' => new sfValidatorChoice(array('choices' => array($this->getObject()->getIdpersonalstructure()), 'empty_value' => $this->getObject()->getIdpersonalstructure(), 'required' => false)),
      'orderId'             => new sfValidatorPropelChoice(array('model' => 'Clientorder', 'column' => 'idOrder')),
      'title'               => new sfValidatorString(array('max_length' => 50)),
      'text'                => new sfValidatorString(array('max_length' => 200)),
    ));

    $this->widgetSchema->setNameFormat('personalstructure[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Personalstructure';
  }


}
